class localCache {
  get(key: string) {
    return (
      window.localStorage.getItem(key) &&
      JSON.parse(window.localStorage.getItem(key) as string)
    );
  }
  set(key: string, value: any) {
    window.localStorage.setItem(key, JSON.stringify(value));
  }
  delete(key: string) {
    return window.localStorage.removeItem(key);
  }
  clear() {
    window.localStorage.clear();
  }
}

export default new localCache();
